package com.sxhalo.fsms.service.impl;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sxhalo.fsms.domain.DeviceLinkageRecord;
import com.sxhalo.fsms.mapper.DeviceLinkageRecordMapper;
import com.sxhalo.fsms.service.IDeviceLinkageRecordService;

@Service
public class DeviceLinkageRecordServiceImpl implements IDeviceLinkageRecordService {

	@Autowired
	private DeviceLinkageRecordMapper mapper;
	
	@Override
	public Integer insertSelective(DeviceLinkageRecord record) {
		return mapper.insertSelective(record);
	}

	@Override
	public Integer updateByPrimaryKeySelective(DeviceLinkageRecord record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public Integer deleteByPrimaryKey(Object key) {
		return mapper.deleteByPrimaryKey(Integer.parseInt(key.toString()));
	}

	@Override
	public DeviceLinkageRecord selectByPrimaryKey(Object key) {
		return mapper.selectByPrimaryKey(Integer.parseInt(key.toString()));
	}

	@Override
	public List<DeviceLinkageRecord> findWhereList(String where, String order) {
		return mapper.findWhereList(where, order);
	}

	@Override
	public Integer getCount(String where) {
		return mapper.getCount(where);
	}

	@Override
	public List< DeviceLinkageRecord> findPagerList(Integer start, Integer length, String where, String order) {
		return mapper.findPagerList(start, length, where, order);
	}

	@Override
	public int batchInsert(List<DeviceLinkageRecord> list) {
		if(list.size()>0){
			return mapper.batchInsert(list);
		}else{
			return  0;
		}

	}

	@Override
	public int deleteByWhere(String where) {
		return mapper.deleteByWhere(where);
	}
}
